<template>
	<view class="income">
		<view class="income-income">
			<view class="income-tips">
				<text>每月25日可提现上月【确认收货】的收益</text>
			</view>
			<view class="income-total">
				<view class="income-amount" @click="gowithdraw()">
					<view>可提现<text>{{order.amount}}</text></view>
					<view>去提现></view>
				</view>
				<view class="income-data-amount">
					<view class="income-data">
						<view>累计到账</view>
						<view>{{order.settlement_all}}</view>
					</view>
					<view class="income-data">
						<view>已提现</view>
						<view>{{order.withdrawals_money}}</view>
					</view>
					<view class="income-data">
						<view>已结算收益</view>
						<view>{{order.settlement_all}}</view>
					</view>
					<view class="income-data">
						<view>本月预估收益</view>
						<view>{{order.this_month}}</view>
					</view>
				</view>
			</view>
		</view>
		
		<view class="income-detail" @click="income_more()">
			<view class="income-detail-title">
				<view>今日日报</view>
				<view>
					<text>查看更多</text>
					<text>></text>
				</view>
			</view>
			<view class="income-detail-data">
				<view class="income-detail-item">
					<view>预估收入</view>
					<view>￥{{order.today.estimate_money}}</view>
				</view>
				<view class="income-detail-item">
					<view>付款订单数</view>
					<view>{{order.today.order_count}}</view>
				</view>
				<view class="income-detail-item">
					<view>我的订单预估收入</view>
					<view>￥{{order.today.estimate_order_money}}</view>
				</view>
				<view class="income-detail-item">
					<view>我的付款订单数</view>
					<view>{{order.today.self_order_count}}</view>
				</view>
				<view class="income-detail-item">
					<view>粉丝订单预估收入</view>
					<view>￥{{order.today.estimate_team_money}}</view>
				</view>
				<view class="income-detail-item">
					<view>粉丝付款订单数</view>
					<view>{{order.today.team_order_count}}</view>
				</view>
			</view>
		</view>
		
		
		<view class="income-detail" @click="income_more()">
			<view class="income-detail-title">
				<view>昨日日报</view>
				<view>
					<text>查看更多</text>
					<text>></text>
				</view>
			</view>
			<view class="income-detail-data">
				<view class="income-detail-item">
					<view>预估收入</view>
					<view>￥{{order.yestoday.estimate_money}}</view>
				</view>
				<view class="income-detail-item">
					<view>付款订单数</view>
					<view>{{order.yestoday.order_count}}</view>
				</view>
				<view class="income-detail-item">
					<view>我的订单预估收入</view>
					<view>￥{{order.yestoday.estimate_order_money}}</view>
				</view>
				<view class="income-detail-item">
					<view>我的付款订单数</view>
					<view>{{order.yestoday.self_order_count}}</view>
				</view>
				<view class="income-detail-item">
					<view>粉丝订单预估收入</view>
					<view>￥{{order.yestoday.estimate_team_money}}</view>
				</view>
				<view class="income-detail-item">
					<view>粉丝付款订单数</view>
					<view>{{order.yestoday.team_order_count}}</view>
				</view>
			</view>
		</view>
		
		
		
	</view>
</template>

<script>
	import tools from "../../common/tools"
	import apiorder from '../../common/api/order';
	export default {
		data() {
			return {
				order:{
					today:[],
					yestoday:[],
				},
			}
		},
		onShow(){
			tools.is_has_login('hasLogin')
			this.myincomedata()
		},
		onLoad() {
		},
		components:{
			apiorder,
		},
		methods: {
			//订单列表
			myincomedata(params={}){
				apiorder.myincomedata(params).then(res =>{
					this.order=res.data;
				}).catch(cateres =>{
					
				});
			},
			
			//去提现
			gowithdraw(){
				uni.navigateTo({
					url:'../money/withdraw'
				})
			},
			
			//查看更多
			income_more(){
				uni.navigateTo({
					url:'./more',
				})
			}
			
		}
	}
</script>

<style scoped>
	.income{
		background: #F5F5F5;
		padding-bottom:40upx;
	}
	.income-income{
		width:100%;
		background-color:#F5F5F5;
	}
	.income-income .income-tips{
		width:100%;
		height:80upx;
		line-height: 80upx;
		background-color: #fff8cc;
	}
	.income-income .income-tips>text{
		padding-left:1%;
		color:#F76260;
	}
	.income-total{
		width:90%;
		margin:20upx auto;
		background-color: #F76260;
		border-radius:40upx;
		padding:20upx 0;
	}
	.income-amount{
		width:90%;
		background:#FFFFFF;
		margin:20upx auto;
		display:flex;
        flex-direction: row;
		border-top-left-radius:20upx;
		border-top-right-radius:20upx;
	}
	.income-amount>view{
		width:50%;
		height:80upx;
		line-height:80upx;
	}
	.income-amount>view:first-child{
		margin-left:20upx;
	}
	.income-amount>view:first-child>text{
		font-weight:bold;
		font-size:40upx;
		margin-left:20upx;
	}
	.income-amount>view:last-child{
		text-align:right;
		margin-right:30upx;
		justify-content: flex-end;
	}
	.income-data-amount{
		width:90%;
		background:#FFFFFF;
		margin:20upx auto;
		display:flex;
        flex-direction: row;
        flex-wrap: wrap;
	}
	.income-data-amount .income-data{
		width:46%;
		padding:2%;
	}
	.income-data>view:last-child{
		font-weight:bold;
		font-size:35upx;
	}
	.income-detail{
		width:90%;
		margin:0 auto;
	}
	.income-detail-title{
		display:flex;
        flex-direction: row;
        flex-wrap: wrap;
	}
	.income-detail-title>view{
		width:50%;
		height:80upx;
		line-height:80upx;
	}
	.income-detail-title>view:first-child{
		font-weight:bold;
		font-size:35upx;
	}
	.income-detail-title>view:last-child{
		text-align:right;
	}
	.income-detail-title>view:last-child>text{
		margin-right:10upx;
		font-weight:bold;
		color: #BFBFBF;
	}
	.income-detail-data{
		width:96%;
		padding:2%;
		display:flex;
        flex-direction: row;
        flex-wrap: wrap;
		background-color:#FFFFFF;
		border-radius:20upx;
	}
	.income-detail-item{
		width:50%;
		padding:10upx 0;
	}
	.income-detail-data>view:first-child>view:last-child{
		font-weight: bold;
		font-size:35upx;
		color:#FF3333;
	}
	.income-detail-data>view:nth-child(2)>view:last-child{
		font-weight: bold;
		font-size:35upx;
		color:#000000;
	}
	.income-detail-item>view:first-child{
		height:50upx;
		line-height:50upx;
		color:#BFBFBF;
	}
	
</style>
